package com.example.tests;

public class ContactData implements Comparable<ContactData> {
	public String firstName;
	public String lastName;
	public String address;
	public String mobile;
	public String email;
	public String bDay;
	public String bMonth;
	public String bYear;

	public ContactData(String firstName, String lastName, String address,
			String mobile, String email, String bDay, String bMonth,
			String bYear) {
		this.firstName = firstName;
		this.lastName = lastName;
		this.address = address;
		this.mobile = mobile;
		this.email = email;
		this.bDay = bDay;
		this.bMonth = bMonth;
		this.bYear = bYear;
	}
	
	public ContactData() {
		
	}

	

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		//result = prime * result	+ ((lastName == null) ? 0 : lastName.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ContactData other = (ContactData) obj;
		if (lastName == null) {
			if (other.lastName != null)
				return false;
		} else if (!lastName.equals(other.lastName))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "ContactData [firstName=" + firstName + ", lastName=" + lastName
				+ ", address=" + address + ", mobile=" + mobile + ", email="
				+ email + ", bDay=" + bDay + ", bMonth=" + bMonth + ", bYear="
				+ bYear + "]";
	}

	@Override
	public int compareTo(ContactData other) {
		
		return this.lastName.toLowerCase().compareTo(other.lastName.toLowerCase());
	}
	
	
	
}